package cn.brilliantfuture.commentry.entity;

// Generated 2011-11-3 13:34:34 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * UserGroup generated by hbm2java
 */
@Entity
@Table(name = "user_group", catalog = "cabinet")
public class UserGroup implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer groupId;
	private int groupType = 1;
	private String name = "-";
	private String groupSn = "-";
	private Area area;
	private boolean hasPic = false;
	private boolean hasExpress = false;
	private byte[] picture;
	private String appCode = "-";
	private String description = "-";
	private boolean deleted = false;
	private String providerName = "-";
	private String hotline = "-";
	private String website = "-";
	private Integer villageId;
	private Integer smsChannel;
	private Set<User> users = new HashSet<User>(0);
	private Set<DeliveryPerson> deliveryPersons = new HashSet<DeliveryPerson>(0);
	private Set<LockersGroup> lockersGroups = new HashSet<LockersGroup>(0);
	private Set<RefundOrderInfo> refundOrderInfos = new HashSet<RefundOrderInfo>(0);
	private Set<PurchaserGroup> purchaserGroups = new HashSet<PurchaserGroup>(0);
	private Set<OrderInformation> orderInformations = new HashSet<OrderInformation>(0);
	private Set<ExpressInfo> expressInfos = new HashSet<ExpressInfo>(0);

	public UserGroup() {
	}

	public UserGroup(String name, boolean deleted) {
		this.name = name;
		this.deleted = deleted;
	}

	public UserGroup(String name, String description, Area area, boolean deleted, int groupType, Set<User> users, Set<DeliveryPerson> deliveryPersons, Set<LockersGroup> lockersGroups, Set<RefundOrderInfo> refundOrderInfos, Set<PurchaserGroup> purchaserGroups, Set<OrderInformation> orderInformations) {
		this.name = name;
		this.description = description;
		this.area = area;
		this.deleted = deleted;
		this.groupType = groupType;
		this.users = users;
		this.deliveryPersons = deliveryPersons;
		this.lockersGroups = lockersGroups;
		this.refundOrderInfos = refundOrderInfos;
		this.purchaserGroups = purchaserGroups;
		this.orderInformations = orderInformations;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "group_id", unique = true, nullable = false)
	public Integer getGroupId() {
		return this.groupId;
	}

	public void setGroupId(Integer groupId) {
		this.groupId = groupId;
	}

	@Column(name = "name", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "description", length = 200)
	@Length(max = 200)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "area")
	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	@Column(name = "deleted", nullable = false)
	public boolean isDeleted() {
		return this.deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	@Column(name = "group_type")
	public int getGroupType() {
		return this.groupType;
	}

	public void setGroupType(int groupType) {
		this.groupType = groupType;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userGroup")
	public Set<User> getUsers() {
		return this.users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userGroup")
	public Set<DeliveryPerson> getDeliveryPersons() {
		return this.deliveryPersons;
	}

	public void setDeliveryPersons(Set<DeliveryPerson> deliveryPersons) {
		this.deliveryPersons = deliveryPersons;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userGroup")
	public Set<LockersGroup> getLockersGroups() {
		return this.lockersGroups;
	}

	public void setLockersGroups(Set<LockersGroup> lockersGroups) {
		this.lockersGroups = lockersGroups;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userGroup")
	public Set<RefundOrderInfo> getRefundOrderInfos() {
		return this.refundOrderInfos;
	}

	public void setRefundOrderInfos(Set<RefundOrderInfo> refundOrderInfos) {
		this.refundOrderInfos = refundOrderInfos;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userGroup")
	public Set<PurchaserGroup> getPurchaserGroups() {
		return this.purchaserGroups;
	}

	public void setPurchaserGroups(Set<PurchaserGroup> purchaserGroups) {
		this.purchaserGroups = purchaserGroups;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "group")
	public Set<OrderInformation> getOrderInformations() {
		return this.orderInformations;
	}

	public void setOrderInformations(Set<OrderInformation> orderInformations) {
		this.orderInformations = orderInformations;
	}

	@Column(name = "app_code", length = 10)
	@Length(max = 10)
	@NotNull
	public String getAppCode() {
		return appCode;
	}

	public void setAppCode(String appCode) {
		this.appCode = appCode;
	}

	@Column(name = "group_sn", length = 3)
	@Length(max = 3)
	@NotNull
	public String getGroupSn() {
		return groupSn;
	}

	public void setGroupSn(String groupSn) {
		this.groupSn = groupSn;
	}
	
	@Column(name = "provider_name", length = 50)
	@Length(max = 50)
	@NotNull
	public String getProviderName() {
		return providerName;
	}

	public void setProviderName(String providerName) {
		this.providerName = providerName;
	}

	@Column(name = "hotline", length = 50)
	@Length(max = 50)
	@NotNull
	public String getHotline() {
		return hotline;
	}

	public void setHotline(String hotline) {
		this.hotline = hotline;
	}

	@Column(name = "website", length = 50)
	@Length(max = 50)
	@NotNull
	public String getWebsite() {
		return website;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	@Lob
	@Column(name = "picture")
	@Basic(fetch = FetchType.LAZY)
	public byte[] getPicture() {
		return picture;
	}

	public void setPicture(byte[] picture) {
		this.picture = picture;
	}

	@Column(name = "has_pic")
	public boolean isHasPic() {
		return hasPic;
	}

	public void setHasPic(boolean hasPic) {
		this.hasPic = hasPic;
	}
	
	@Column(name = "village_id")
	public Integer getVillageId() {
		return villageId;
	}

	public void setVillageId(Integer villageId) {
		this.villageId = villageId;
	}

	@Column(name = "has_express")
	public boolean isHasExpress() {
		return hasExpress;
	}

	public void setHasExpress(boolean hasExpress) {
		this.hasExpress = hasExpress;
	}

	@Column(name = "sms_channel", nullable = false)
	public Integer getSmsChannel() {
		return smsChannel;
	}

	public void setSmsChannel(Integer smsChannel) {
		this.smsChannel = smsChannel;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "group")
	public Set<ExpressInfo> getExpressInfos() {
		return expressInfos;
	}

	public void setExpressInfos(Set<ExpressInfo> expressInfos) {
		this.expressInfos = expressInfos;
	}

}
